]> dgit.raspbian.org Git - gnome-shell.git/commitdiff
screenshot-ui: Add mode argument to open()
authorIvan Molodetskikh <yalterz@gmail.com>
Thu, 3 Feb 2022 19:47:07 +0000 (22:47 +0300)
committerMarge Bot <marge-bot@gnome.org>
Sat, 12 Feb 2022 12:13:22 +0000 (12:13 +0000)
In a subsequent commit we will add a function to open the screenshot UI
in the screencast mode. This argument will allow us to do that without
resorting to accessing private fields from the outside.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/2107>

js/ui/screenshot.js

index 3740975b1d9a4834e308a747c0f9b30db3c005bd..eb9d21a5df2132159474d1846380c2472e7cf0b3 100644 (file)
@@ -988,6 +988,11 @@ class UIWindowSelector extends St.Widget {
     }
 });
 
+const UIMode = {
+    SCREENSHOT: 0,
+    SCREENCAST: 1,
+};
+
 var ScreenshotUI = GObject.registerClass({
     Properties: {
         'screencast-in-progress': GObject.ParamSpec.boolean(
@@ -1408,13 +1413,15 @@ var ScreenshotUI = GObject.registerClass({
             this._screenSelectors[Main.layoutManager.primaryIndex].checked = true;
     }
 
-    async open() {
+    async open(mode = UIMode.SCREENSHOT) {
         if (this._openingCoroutineInProgress)
             return;
 
         if (this._screencastInProgress)
             return;
 
+        this._castButton.checked = mode === UIMode.SCREENCAST;
+
         if (!this.visible) {
             // Screenshot UI is opening from completely closed state
             // (rather than opening back from in process of closing).